package cc.ipost.ipost.data;

import java.util.HashMap;
import java.util.Map;

import cc.ipost.ipost.MySettings;

public class RequestData {
	public static final int GET = 1;
	public static final int POST = 2;
	public static final int PUT = 3;
	public static final int DELETE = 4;
	public String url;
	public int method = GET;
	public Map<String, Object> params;
	public String fileField;
	public String filepath;
	
	public RequestData(String uri, int method) {
		this.url = MySettings.API + uri;
		this.method = method;
		this.params = new HashMap<String, Object>();
	}
	
	public void addParam(String k, Object v) {
		this.params.put(k, v);
	}
	
	public void setFile(String field, String filepath) {
		this.fileField = field;
		this.filepath = filepath;
	}
}
